#coding: utf-8

import os

_ROOT = os.path.abspath(os.path.dirname(__file__))

DEBUG_LOGGING = {
    'version': 1,
    'disable_existing_loggers': True,
    'formatters': {
        'verbose': {
            'format': '%(name)s %(levelname)s %(asctime)s %(module)s  %(process)d %(thread)d %(message)s'
        },
        'file': {
            'format': '%(asctime)s [%(name)s / %(module)s] [%(levelname)s] %(message)s'
        },
        'simple': {
            'format': '%(asctime)s %(levelname)s %(message)s'
        },
        },
    #'filters': {
    #    'special': {
    #        '()': 'project.logging.SpecialFilter',
    #        'foo': 'bar',
    #    }
    #},

    'handlers': {
        'null': {
            'level':'DEBUG',
            'class':'django.utils.log.NullHandler',
            },
        'file': {                 # define and name a second handler
                                  'level': 'DEBUG',
                                  'class': 'logging.FileHandler', # set the logging class to log to a file
                                  'formatter': 'file',         # define the formatter to associate
                                  'filename': os.path.join(_ROOT, '../var', 'django.log')  # log file
        },
        'console':{
            'level':'ERROR',
            'class':'logging.StreamHandler',
            'formatter': 'simple'
        },
        'mail_admins': {
            'level': 'ERROR',
            'class': 'django.utils.log.AdminEmailHandler',
            #'filters': ['special']
        }
    },
    'loggers': {
        'django': {
            'handlers':['null'],
            'propagate': True,
            'level':'INFO',
        }
    }
}
